<template>
	<div>
		<v-chart :data="data">
			<v-scale x :tick-count="0" />
			<v-point
				:style="{
          stroke: '#fff',
          lineWidth: 1
        }"
				shape="smooth" />
			<v-line shape="smooth" />
		</v-chart>
	</div>
</template>

<script>
	import NetWorking from '../../../../utils/networking'
	import { VChart, VLine, VPoint, VScale, VTooltip } from 'vux'

	export default {
		name: "discovery-pie-chart",
		components: {
			VChart,
			VLine,
			VPoint,
			VScale,
			VTooltip
		},
		beforeCreate: function () {
			let _this = this

			NetWorking.doGet(
				'ai/getMemberAgeRange',
				null,
				null
			).then(
				response => {
					let rs = response.data
					if(rs.error_code == 0){
						for(let i=0; i<rs.ai_status_age.length; i++){
							_this.data.push({姓名: rs.ai_status_age[i].key + '岁', 数量: parseFloat(rs.ai_status_age[i].value)})
						}
					}
				}
			)
		},
		data () {
			return {
				data: [{ 姓名: '', 数量: 0}]
			}
		}
	}
</script>

<style scoped>

</style>